AT-NFC  2.1 (win)
AT-NFC kernel set
Functions
nfc_visa_lib.h File Reference

Go to the source code of this file.

Functions

KER_RES KER_API visaNfcInit (KER_CTX_INIT_PARAM const KER_VOID *pConfigID, KER_INT16U usConfigIDLen, const KER_CHAR *pchKernelFiles, KER_INT16U usKernelFilesLen)
 Performs kernel initialization. More...
 
KER_RES KER_API visaNfcDeInit (KER_CTX_SINGLE_PARAM)
 Performs kernel de-initialization. More...
 
KER_BOOL KER_API visaNfcVerInfo (KER_CTX_PARAM const KER_CHAR **ppchEmvVer, KER_INT16U *pusEmvVerLen, const KER_CHAR **ppchLibVer, KER_INT16U *pusLibVerLen)
 Obtains emv kernel library version info. More...
 
KER_RES KER_API visaNfcTran (KER_CTX_PARAM const NFC_EP_PRE_DATA *pEpPRE, const NFC_EP_PPSE_DATA *pEpPPSE, const NFC_EP_TRAN_DATA *pEpTranData, KER_TRAN **ppTran, NFC_OUTCOME **ppOutcome)
 Initiates transaction bprocessing by kernel. More...
 
KER_RES KER_API visaNfcTranIssUpdate (KER_CTX_PARAM KER_TRAN *pTran, const NFC_EP_RESTART_DATA *pEpRestartData, const NFC_EXT_TERM_RESTART_DATA *pTermRestartData, NFC_OUTCOME **ppOutcome)
 Process issuer update request. More...
 
KER_BOOL KER_API visaNfcTranRelease (KER_CTX_PARAM KER_TRAN *pTran)
 Releases NFC Transaction container structure. More...
 
KER_RES KER_API visaNfcGetData (KER_CTX_PARAM KER_TRAN *pTran, KER_INT16U usOptions, KER_BYTE *pbtData, KER_INT16U *pusDataLen)
 Transaction data request. More...
 
KER_RES KER_API visaNfcGetDataByTag (KER_CTX_PARAM KER_TRAN *pTran, KER_INT16U usOptions, const KER_BYTE *pbtTag, KER_BYTE btTagSize, KER_BYTE *pbtData, KER_INT16U *pusDataSize)
 transaction data request More...
 
KER_RES KER_API visaNfcGetDataByTagList (KER_CTX_PARAM KER_TRAN *pTran, KER_INT16U usOptions, const KER_BYTE *pbtTagList, KER_INT16U usTagListSize, KER_BYTE *pbtData, KER_INT16U *pusDataSize)
 transaction data request More...
 
KER_BOOL KER_API visaCheckOption (KER_CTX_PARAM KER_TRAN *pTran, KER_INT16U usOption, KER_INT16U usParam, KER_VOID *pParam)
 Check options callback Define this function outside the lib to provide kernel options. More...
 

Detailed Description

NFC VISA KERNEL library export functions (with uniqe names to link several kernel libs in one project)

Function Documentation

◆ visaCheckOption()

KER_BOOL KER_API visaCheckOption ( KER_CTX_PARAM KER_TRAN pTran,
KER_INT16U  usOption,
KER_INT16U  usParam,
KER_VOID pParam 
)

Check options callback Define this function outside the lib to provide kernel options.

Parameters
[in]pTran- pointer to the transaction structure (obtained by visaNfcTran)
[in]usOption- option to check (NFC_KER_OPT_DEBUG, NFC_KER_OPT_RRP)
[in]usParam- reserved.
[in]pParam- reserved.
Returns
KER_TRUE - option enabled
KER_FALSE - option disabled

◆ visaNfcDeInit()

KER_RES KER_API visaNfcDeInit ( KER_CTX_SINGLE_PARAM  )

Performs kernel de-initialization.

Returns
KER_OK Success.
Other - failure.

Terminal Application should de-init kernel by this function

Warning
Do not call this function if visaNfcInit failed.

◆ visaNfcGetData()

KER_RES KER_API visaNfcGetData ( KER_CTX_PARAM KER_TRAN pTran,
KER_INT16U  usOptions,
KER_BYTE pbtData,
KER_INT16U pusDataLen 
)

Transaction data request.

call this function to obtain transaction data from kernel (as a flat TLV with all data available)

Parameters
[in]pTran- pointer to the transaction structure (obtained by visaNfcTran)
[in]usOptions- get options (bitmask), reserved
[out]pbtData- Buffer to obtain transaction data (in TLV) (path KER_NULL if you need to calculate tran data length only)
[in,out]pusDataLen- Size of Buffer pbtData as input, data length as output
Returns
KER_OK Success
Other Failure

◆ visaNfcGetDataByTag()

KER_RES KER_API visaNfcGetDataByTag ( KER_CTX_PARAM KER_TRAN pTran,
KER_INT16U  usOptions,
const KER_BYTE pbtTag,
KER_BYTE  btTagSize,
KER_BYTE pbtData,
KER_INT16U pusDataSize 
)

transaction data request

call this function to obtain transaction data by tag from kernel

Parameters
[in]pTran- pointer to the transaction structure (obtained by visaNfcTran)
[in]usOptions- get options (bitmask), reserved
[in]pbtTag- buffer with tag value
[in]btTagSize- pbtTag value length
[out]pbtData- buffer to obtain provided tag value
[in,out]pusDataSize- pbtData buffer size as input, output containes result data length
Returns
KER_OK Success
KER_ERR_COMMON_NOT_FOUND Tag not found
Other Failure

◆ visaNfcGetDataByTagList()

KER_RES KER_API visaNfcGetDataByTagList ( KER_CTX_PARAM KER_TRAN pTran,
KER_INT16U  usOptions,
const KER_BYTE pbtTagList,
KER_INT16U  usTagListSize,
KER_BYTE pbtData,
KER_INT16U pusDataSize 
)

transaction data request

call this function to obtain transaction data by tag list from kernel

Parameters
[in]pTran- pointer to the transaction structure (obtained by visaNfcTran)
[in]usOptions- get options (bitmask), reserved
[in]pbtTagList- buffer with tag list
[in]usTagListSize- pbtTagList value length
[out]pbtData- buffer to obtain provided tag list in TLV format
[in,out]pusDataSize- pbtData buffer size as input, output containes result data length
Returns
KER_OK Success
Other Failure

◆ visaNfcInit()

KER_RES KER_API visaNfcInit ( KER_CTX_INIT_PARAM const KER_VOID pConfigID,
KER_INT16U  usConfigIDLen,
const KER_CHAR pchKernelFiles,
KER_INT16U  usKernelFilesLen 
)

Performs kernel initialization.

Parameters
[in]pConfigIDBuffer with configuration ID obtained from Terminal Application (in HAL recognized format)
[in]usConfigIDLenpConfigID buffer length
[in]pchKernelFilesbuffer with kernel binary file names (for checksum calculation) - set of nul terminated strings ended by nul.
[in]usKernelFilesLenlength of pchKernelFiles including nul-terminating sym
Returns
KER_OK Success.
Other - failure.

Terminal Application should init kernel by this function before calling any other kernel functions

Warning
If visaNfcInit returns KER_OK, Terminal Application should call visaNfcDeInit finally to release allocated resources.

◆ visaNfcTran()

KER_RES KER_API visaNfcTran ( KER_CTX_PARAM const NFC_EP_PRE_DATA pEpPRE,
const NFC_EP_PPSE_DATA pEpPPSE,
const NFC_EP_TRAN_DATA pEpTranData,
KER_TRAN **  ppTran,
NFC_OUTCOME **  ppOutcome 
)

Initiates transaction bprocessing by kernel.

This function initiates NFC transaction processing by kernel, based on Select command results (from EP)

Parameters
[in]pEpPRE- Entry Point preprocesing data
[in]pEpPPSE- Entry Point selected aid related PPSE data
[in]pEpTranData- transaction data maintained by Entry Point
[out]ppTran- pointer to obtain transaction context
[out]ppOutcome- pointer to obtain transaction outcome
Returns
KER_OK Success, see outcome for details.
KER_ERR_COMMON_CARD_HW_ERR Card communication failure - abort transaction
Other errors (Kernel Error Codes) Failure - abort transaction.
Warning
When tranaction context (ppTran) no longer required call kerTranRelease. Do it despite of result code retuned.
ppOutcome reference to transaction outcome valid till transaction completion.

◆ visaNfcTranIssUpdate()

KER_RES KER_API visaNfcTranIssUpdate ( KER_CTX_PARAM KER_TRAN pTran,
const NFC_EP_RESTART_DATA pEpRestartData,
const NFC_EXT_TERM_RESTART_DATA pTermRestartData,
NFC_OUTCOME **  ppOutcome 
)

Process issuer update request.

This function processes issuer update request by kernel

Parameters
[in]pTran- pointer to the transaction structure (obtained by visaNfcTran)
[in]pEpRestartData- Entry Point transaction restart data (last FCI)
[in]pTermRestartData- Terminal transaction restart data (issuer update data assumed)
[out]ppOutcome- pointer to obtain transaction outcome
Returns
NFC_INF_OUTCOME Success, see outcome for details.
NFC_INF_INV_COMM_SEQUESNCE Issuer update unexpected.
KER_ERR_COMMON_CARD_HW_ERR Card communication failure - abort transaction
Other errors (Kernel Error Codes) Failure - abort transaction.

◆ visaNfcTranRelease()

KER_BOOL KER_API visaNfcTranRelease ( KER_CTX_PARAM KER_TRAN pTran)

Releases NFC Transaction container structure.

Parameters
[in]pTran- pointer to the transaction structure to release (obtained by visaNfcTran)
Returns
KER_TRUE Success.
KER_FALSE Failure. Execution failed due to invalid param or memory error.

◆ visaNfcVerInfo()

KER_BOOL KER_API visaNfcVerInfo ( KER_CTX_PARAM const KER_CHAR **  ppchEmvVer,
KER_INT16U pusEmvVerLen,
const KER_CHAR **  ppchLibVer,
KER_INT16U pusLibVerLen 
)

Obtains emv kernel library version info.

Parameters
[out]ppchEmvVerpointer to obtain reference to Kernel Specification version info (optional, set KER_NULL if you don't need it)
[out]pusEmvVerLenlength of data, including nul-terminated symbol (optional, set KER_NULL if you don't need it)
[out]ppchLibVerpointer to obtain reference to kernel library version info (optional, set KER_NULL if you don't need it)
[out]pusLibVerLenlength of data, including nul-terminated symbol (optional, set KER_NULL if you don't need it)
Returns
KER_TRUE Success.
KER_FALSE Failure. Execution failed due to invalid param.